import request from '@/utils/request'

// 查询问卷数据列表
export function listNaire(query) {
  return request({
    url: '/system/naire/list',
    method: 'get',
    params: query
  })
}

export function listNaire2(query) {
  return request({
    url: '/system/naire/list2',
    method: 'get',
    params: query
  })
}

export function listNaireForCompany(companyId) {
  return request({
    url: '/system/naire/listforcompany/'+companyId,
    method: 'get'
  })
}

export function checkStatus(query) {
  return request({
    url: '/system/naire/status',
    method: 'get',
    params: query
  })
}

// 查询问卷数据详细
export function getNaire(naireId) {
  return request({
    url: '/system/naire/' + naireId,
    method: 'get'
  })
}

// 查询问卷数据详细
export function getNaireQuestions2(naireId,domainId) {
  return request({
    url: '/system/naire/questions?naireId=' + naireId+'&domainId='+domainId,
    method: 'get'
  })
}

// 查询问卷数据详细
export function getNaireQuestions(query) {
  return request({
    url: '/system/naire/listquestions',
    method: 'get',
    params: query
  })
}

// 查询问卷数据详细
export function getNaireQuestionsWithGrade(query) {
  return request({
    url: '/system/naire/listquestions2',
    method: 'get',
    params: query
  })
}


export function startDiagnosis4GLeader(query) {
  return request({
    url: '/system/naire/startdiagnosis4gleader',
    method: 'get',
    params: query
  })
}

// 新增问卷数据
export function addNaire(data) {
  return request({
    url: '/system/naire',
    method: 'post',
    data: data
  })
}

// 修改问卷数据
export function updateNaire(data) {
  return request({
    url: '/system/naire',
    method: 'put',
    data: data
  })
}

// 删除问卷数据
export function delNaire(naireId) {
  return request({
    url: '/system/naire/' + naireId,
    method: 'delete'
  })
}
